package org.jash.day3

/**
 * Created by Jash
 */

// 扩展方法
fun String.say() {
    println("说: $this")
}
fun main() {
//    "123".say()

    "张三" eat "苹果"
    "张三".eat("苹果")
    1 until 10
    1.until(10)
    println("1234" * 3)
}

infix fun String.eat(food:String) {
    println("$this 吃了一个 $food")
}
// 运算符重载
operator fun String.times(i:Int):String {
    return repeat(i)
}